package com.jxpanda.spring.module.auth.core.register.strategy;

import com.jxpanda.spring.module.auth.core.user.OAuth2ReactiveUserDetailsRepository;

/**
 * 默认的策略
 * 该策略会在用户通过oauth2验证成功后
 * 如果本地未注册的时候自动注册用户
 */
public record DefaultUserDetailsRepositoryReactiveRegisterStrategy(
        OAuth2ReactiveUserDetailsRepository oAuth2ReactiveUserDetailsRepository)
        implements OAuth2UserDetailsRepositoryReactiveRegisterStrategy {

    @Override
    public boolean isSupport(String grantType) {
        return true;
    }

    @Override
    public boolean shouldAutoRegister() {
        return true;
    }
}
